/*
 * @Author: your name
 * @Date: 2021-10-26 19:02:44
 * @LastEditTime: 2021-10-26 19:12:08
 * @LastEditors: your name
 * @Description: In User Settings Edit
 * @FilePath: \ej-customer\src\store\user\user.js
 */
import { get, post, post_json } from '@/http/axios'
export default {
  namespaced: true,
  state: {
    userInfo: {}
  },
  mutations: {
    SET_UserInfo(state, userInfo){
      state.userInfo = userInfo
    }
  },
  actions: {
    // 获取用户信息
    async getUserInfo({commit}, params) {
      let res = await get('/user/info?token='+localStorage.getItem('token'))
      commit('SET_UserInfo', res.data.data)
    }
  }
}